/**
 * 配置
 */

// 配置title组件和

/**
 * 输入框类型type
 * 'SELECT'--下拉，
 * 'INPUT'--输入框，
 * 'INPUTNUMBER'---数字输入框，
 * 'DATE'---单个时间输入
 * 'DOUBLEDATE'--两个时间数据
 * 'OTHER'----其他类型
 */

const space = '10px';
export const config1 = [
  {
    type: 1,
    name: '期权基础信息',
    hasOpen: false, //是否有下拉
    key: 'bookMain',
    info: {
      optionType: {
        key: 'optionType',
        name: '期权类型',
        isRequired: false, // 是否必填true
        isGrey: true, //是否置灰
        space: space, //向下间隔(margin-bottom)
      },
      isAnnualized: {
        key: 'isAnnualized',
        name: '是否年化',
        isRequired: true, // 是否必填
        isGrey: false, //是否置灰
        space: space, //向下间隔(margin-bottom)
      },
      tradeStatus: {
        key: 'tradeStatus',
        name: '交易状态',
        isRequired: false, // 是否必填
        isGrey: true, //是否置灰
        space: space, //向下间隔(margin-bottom)
      },
      // tradeId:{
      //   key:'tradeId',
      //   name:'交易编号',
      //   isRequired:false, // 是否必填
      //   isGrey:true, //是否置灰
      //   space:space, //向下间隔(margin-bottom)
      // },
      contractId: {
        key: 'contractId',
        name: '合约编号',
        isRequired: false, // 是否必填
        isGrey: false, //是否置灰
        space: space, //向下间隔(margin-bottom)
      },
      productId: {
        key: 'productId',
        name: '产品名称',
        isRequired: true, // 是否必填
        isGrey: false, //是否置灰
        space: space, //向下间隔(margin-bottom)
      },
      counterpartyId: {
        key: 'counterpartyId',
        name: '交易对手',
        isRequired: true, // 是否必填
        isGrey: false, //是否置灰
        space: space, //向下间隔(margin-bottom)
      },
      // counterpartyId:{
      //   key:'counterpartyId',
      //   name:'交易对手ID',
      //   isRequired:false, // 是否必填
      //   isGrey:true, //是否置灰
      //   space:space, //向下间隔(margin-bottom)
      // },
      // underlying:{
      //   key:'underlying',
      //   name:'标的证券',
      //   isRequired:true, // 是否必填
      //   isGrey:false, //是否置灰
      //   space:space, //向下间隔(margin-bottom)
      // },
      tradingCode: {
        key: 'tradingCode',
        name: '标的证券',
        isRequired: true, // 是否必填
        isGrey: false, //是否置灰
        space: space, //向下间隔(margin-bottom)
      },
      // exchangeCode:{
      //   key:'exchangeCode',
      //   name:'交易市场',
      //   isRequired:false, // 是否必填
      //   isGrey:true, //是否置灰
      //   space:space, //向下间隔(margin-bottom)
      // },
      underlyingType: {
        key: 'underlyingType',
        name: '标的类型',
        isRequired: false, // 是否必填
        isGrey: true, //是否置灰
        space: space, //向下间隔(margin-bottom)
      },
      tradeDate: {
        key: 'tradeDate',
        name: '交易日期',
        isRequired: true, // 是否必填
        isGrey: false, //是否置灰
        space: space, //向下间隔(margin-bottom)
      },
      effectiveDate: {
        key: 'effectiveDate',
        name: '起始日期',
        isRequired: true, // 是否必填
        isGrey: false, //是否置灰
        space: space, //向下间隔(margin-bottom)
      },
      expiryDate: {
        key: 'expiryDate',
        name: '到期日期',
        isRequired: true, // 是否必填
        isGrey: false, //是否置灰
        space: space, //向下间隔(margin-bottom)
      },
      settleDate: {
        key: 'settleDate',
        name: '结算日期',
        isRequired: true, // 是否必填
        isGrey: false, //是否置灰
        space: space, //向下间隔(margin-bottom)
      },
      tradeDir: {
        key: 'tradeDir',
        name: '买卖方向',
        isRequired: true, // 是否必填
        isGrey: false, //是否置灰
        space: space, //向下间隔(margin-bottom)
      },
      excerciseDir: {
        key: 'excerciseDir',
        name: '行权方向',
        isRequired: false, // 是否必填
        isGrey: false, //是否置灰
        space: space, //向下间隔(margin-bottom)
      },
      initialPrice: {
        key: 'initialPrice',
        name: '期初价格',
        isRequired: true, // 是否必填
        isGrey: false, //是否置灰
        space: space, //向下间隔(margin-bottom)
      },
      notional: {
        key: 'notional',
        name: '名义本金',
        isRequired: false, // 是否必填
        isGrey: false, //是否置灰
        space: space, //向下间隔(margin-bottom)
      },
      notionalCcy: {
        key: 'notionalCcy',
        name: '名义本金币种',
        isRequired: true, // 是否必填
        isGrey: false, //是否置灰
        space: space, //向下间隔(margin-bottom)
      },
      quantity: {
        key: 'quantity',
        name: '名义数量',
        isRequired: false, // 是否必填
        isGrey: true, //是否置灰
        space: space, //向下间隔(margin-bottom)
      },

      strikeRate: {
        key: 'strikeRate',
        name: '行权价格率',
        isRequired: false, // 是否必填
        isGrey: false, //是否置灰
        space: space, //向下间隔(margin-bottom)
      },
      strike: {
        key: 'strike',
        name: '行权价格',
        isRequired: false, // 是否必填
        isGrey: false, //是否置灰
        space: space, //向下间隔(margin-bottom)
      },
      premiumDate: {
        key: 'premiumDate',
        name: '期权费支付日期',
        isRequired: false, // 是否必填
        isGrey: false, //是否置灰
        space: space, //向下间隔(margin-bottom)
      },
      premiumRate: {
        key: 'premiumRate',
        name: '期权费率',
        isRequired: false, // 是否必填
        isGrey: false, //是否置灰
        space: space, //向下间隔(margin-bottom)
      },
      premium: {
        key: 'premium',
        name: '期权费',
        isRequired: false, // 是否必填
        isGrey: false, //是否置灰
        space: space, //向下间隔(margin-bottom)
      },
      premiumCcy: {
        key: 'premiumCcy',
        name: '期权费币种',
        isRequired: false, // 是否必填
        isGrey: false, //是否置灰
        space: space, //向下间隔(margin-bottom)
      },
      priceType: {
        key: 'priceType',
        name: '期末价格类型',
        isRequired: true, // 是否必填
        isGrey: false, //是否置灰
        space: space, //向下间隔(margin-bottom)
      },
      participationRate: {
        key: 'participationRate',
        name: '参与率',
        isRequired: true, // 是否必填
        isGrey: false, //是否置灰
        space: space, //向下间隔(margin-bottom)
      },
      couponRate: {
        key: 'couponRate',
        name: '票息',
        isRequired: false, // 是否必填
        isGrey: false, //是否置灰
        space: space, //向下间隔(margin-bottom)
      },
    },
  },
  {
    type: 2,
    name: '香草期权子表',
    hasOpen: true, //是否有下拉
    key: 'bookVanilla',
    info: {
      exerciseType: {
        key: 'exerciseType',
        name: '行权方式',
        isRequired: false, // 是否必填true
        isGrey: false, //是否置灰
        space: space, //向下间隔(margin-bottom)
      },
    },
  },
  {
    type: 3,
    name: '障碍期权子表',
    hasOpen: true, //是否有下拉
    key: 'bookBarrier',
    info: {
      barrierDuration: {
        key: 'barrierDuration',
        name: '观察频率',
        isRequired: false, // 是否必填true
        isGrey: false, //是否置灰
        space: space, //向下间隔(margin-bottom)
      },
      barrierType: {
        key: 'barrierType',
        name: '障碍类型',
        isRequired: false, // 是否必填true
        isGrey: false, //是否置灰
        space: space, //向下间隔(margin-bottom)
      },
      observation: {
        key: 'observation',
        name: '观察日区间',
        isRequired: false, // 是否必填true
        isGrey: false, //是否置灰
        space: space, //向下间隔(margin-bottom),
        children: [
          {
            key: 'observationStart',
            name: '观察日区间',
            isRequired: false, // 是否必填true
            isGrey: false, //是否置灰
            space: space, //向下间隔(margin-bottom),
          },
          {
            key: 'observationEnd',
            name: '观察日区间',
            isRequired: false, // 是否必填true
            isGrey: false, //是否置灰
            space: space, //向下间隔(margin-bottom),
          },
        ],
      },
      observationDate: {
        key: 'observationDate',
        name: '观察日序列',
        isRequired: false, // 是否必填true
        isGrey: false, //是否置灰
        space: '102px', //向下间隔(margin-bottom)
      },
      // barrierMonitoring:{
      //   key:'barrierMonitoring',
      //   name:'观察价格类型',
      //   isRequired:false, // 是否必填true
      //   isGrey:false, //是否置灰
      //   space:space, //向下间隔(margin-bottom)
      // },
      barrierRate1: {
        key: 'barrierRate1',
        name: '障碍价格率1',
        isRequired: false, // 是否必填true
        isGrey: false, //是否置灰
        space: space, //向下间隔(margin-bottom)
      },
      barrier1: {
        key: 'barrier1',
        name: '障碍价格1',
        isRequired: false, // 是否必填true
        isGrey: false, //是否置灰
        space: space, //向下间隔(margin-bottom)
      },
      barrierRate2: {
        key: 'barrierRate2',
        name: '障碍价格率2',
        isRequired: false, // 是否必填true
        isGrey: false, //是否置灰
        space: space, //向下间隔(margin-bottom)
      },
      barrier2: {
        key: 'barrier2',
        name: '障碍价格2',
        isRequired: false, // 是否必填true
        isGrey: false, //是否置灰
        space: space, //向下间隔(margin-bottom)
      },
      rebate1: {
        key: 'rebate1',
        name: '敲出收益率',
        isRequired: false, // 是否必填true
        isGrey: false, //是否置灰
        space: space, //向下间隔(margin-bottom)
      },
      rebate2: {
        key: 'rebate2',
        name: '敲出收益率2',
        isRequired: false, // 是否必填true
        isGrey: false, //是否置灰
        space: space, //向下间隔(margin-bottom)
      },
      settleMode: {
        key: 'settleMode',
        name: '结算方式',
        isRequired: false, // 是否必填true
        isGrey: false, //是否置灰
        space: space, //向下间隔(margin-bottom)
      },
    },
  },
  {
    type: 4,
    name: '二元期权子表',
    hasOpen: true, //是否有下拉
    key: 'bookDual',
    info: {
      digitalAmount: {
        key: 'digitalAmount',
        name: '触碰比例',
        isRequired: false, // 是否必填true
        isGrey: false, //是否置灰
        space: space, //向下间隔(margin-bottom)
      },
      triggerDuration: {
        key: 'triggerDuration',
        name: '观察频率',
        isRequired: false, // 是否必填true
        isGrey: false, //是否置灰
        space: space, //向下间隔(margin-bottom)
      },
      triggerType: {
        key: 'triggerType',
        name: '触碰类型',
        isRequired: false, // 是否必填true
        isGrey: false, //是否置灰
        space: space, //向下间隔(margin-bottom)
      },
      observation: {
        key: 'observation',
        name: '观察日区间',
        isRequired: false, // 是否必填true
        isGrey: false, //是否置灰
        space: space, //向下间隔(margin-bottom),
        children: [
          {
            key: 'observationStart',
            name: '观察日区间',
            isRequired: false, // 是否必填true
            isGrey: false, //是否置灰
            space: space, //向下间隔(margin-bottom),
          },
          {
            key: 'observationEnd',
            name: '观察日区间',
            isRequired: false, // 是否必填true
            isGrey: false, //是否置灰
            space: space, //向下间隔(margin-bottom),
          },
        ],
      },
      observationDate: {
        key: 'observationDate',
        name: '观察日序列',
        isRequired: false, // 是否必填true
        isGrey: false, //是否置灰
        space: '102px', //向下间隔(margin-bottom)
      },
      triggerRate1: {
        key: 'triggerRate1',
        name: '触碰价格率1',
        isRequired: false, // 是否必填true
        isGrey: false, //是否置灰
        space: space, //向下间隔(margin-bottom)
      },
      trigger1: {
        key: 'trigger1',
        name: '触碰价格1',
        isRequired: false, // 是否必填true
        isGrey: false, //是否置灰
        space: space, //向下间隔(margin-bottom)
      },
      triggerRate2: {
        key: 'triggerRate2',
        name: '触碰价格率2',
        isRequired: false, // 是否必填true
        isGrey: false, //是否置灰
        space: space, //向下间隔(margin-bottom)
      },
      trigger2: {
        key: 'trigger2',
        name: '触碰价格2',
        isRequired: false, // 是否必填true
        isGrey: false, //是否置灰
        space: space, //向下间隔(margin-bottom)
      },
      settleMode: {
        key: 'settleMode',
        name: '结算方式',
        isRequired: false, // 是否必填true
        isGrey: false, //是否置灰
        space: space, //向下间隔(margin-bottom)
      },
    },
  },
  {
    type: 7,
    name: '雪球期权子表',
    hasOpen: true, //是否有下拉
    key: 'bookSnowball',
    info: {
      kiBarrierDuration: {
        key: 'kiBarrierDuration',
        name: '敲入_观察频率',
        isRequired: true, // 是否必填true
        isGrey: true, //是否置灰
        space: space, //向下间隔(margin-bottom)
      },
      kiDirection: {
        key: 'kiDirection',
        name: '敲入方向',
        isRequired: true, // 是否必填true
        isGrey: false, //是否置灰
        space: space, //向下间隔(margin-bottom)
      },
      kiBarrierRate: {
        key: 'kiBarrierRate',
        name: '敲入_障碍价格率',
        isRequired: true, // 是否必填true
        isGrey: false, //是否置灰
        space: space, //向下间隔(margin-bottom)
      },
      kiBarrier: {
        key: 'kiBarrier',
        name: '敲入_障碍价格',
        isRequired: true, // 是否必填true
        isGrey: false, //是否置灰
        space: space, //向下间隔(margin-bottom),
      },
      koBarrierDuration: {
        key: 'koBarrierDuration',
        name: '敲出_观察频率',
        isRequired: true, // 是否必填true
        isGrey: true, //是否置灰
        space: space, //向下间隔(margin-bottom)
      },
      koObservationDate: {
        key: 'koObservationDate',
        name: '敲出_观察序列',
        isRequired: true, // 是否必填true
        isGrey: false, //是否置灰
        space: '102px', //向下间隔(margin-bottom)
        children: [
          {
            key: 'koBarrierRate',
            name: '观察日期',
            isRequired: true, // 是否必填true
            isGrey: false, //是否置灰
            space: space, //向下间隔(margin-bottom),
          },
          {
            key: 'koBarrier',
            name: '敲出障碍价格率',
            isRequired: true, // 是否必填true
            isGrey: false, //是否置灰
            space: space, //向下间隔(margin-bottom),
          },
        ],
      },
      koDirection: {
        key: 'koDirection',
        name: '敲出方向',
        isRequired: true, // 是否必填true
        isGrey: false, //是否置灰
        space: space, //向下间隔(margin-bottom)
      },
      rebate: {
        key: 'rebate',
        name: '敲出收益率',
        isRequired: true, // 是否必填true
        isGrey: false, //是否置灰
        space: space, //向下间隔(margin-bottom)
      },
      settleMode: {
        key: 'settleMode',
        name: '结算方式',
        isRequired: true, // 是否必填true
        isGrey: false, //是否置灰
        space: space, //向下间隔(margin-bottom)
      },
    },
  },
];

// 枚举值对应的key值

export const dict = {
  /**
     * 期权结构 OTC_OPTION_BOOK_OPTIONSTRUCT
      期权类型 OTC_OPTION_BOOK_OPTIONTYPE
      买卖方向 OTC_OPTION_BOOK_OPTION_TRADEDIR
      行权方向 OTC_OPTION_BOOK_OPTION_EXCERCISEDIR
      名义本金币种 OTC_OPTION_BOOK_OPTION_NOTIONALCCY
      期权费币种 OTC_OPTION_BOOK_OPTION_PREMINMCCY
      期末价格类型 OTC_OPTION_BOOK_PRICETYPE
     */
  structure: 'OTC_OPTION_BOOK_OPTIONSTRUCT', // 期权结构
  optionType: 'OTC_OPTION_BOOK_OPTIONTYPE', // 期权类型
  tradeDir: 'OTC_OPTION_BOOK_OPTION_TRADEDIR', // 买卖方向
  excerciseDir: 'OTC_OPTION_BOOK_OPTION_EXCERCISEDIR', // 行权方向
  notionalCcy: 'OTC_OPTION_BOOK_OPTION_NOTIONALCCY', // 名义本金币种
  premiumCcy: 'OTC_OPTION_BOOK_OPTION_PREMINMCCY', // 期权费币种
  priceType: 'OTC_OPTION_BOOK_PRICETYPE', // 期末价格类型
  underlyingType: 'MAAT_OPTION_UNDERLYING_TYPE', // 标的类型
  /**
   * 行权方式  OTC_OPTION_BOOK_EXERCISETYPE
观察频率 OTC_OPTION_BOOK_BARRIERDUTATION
障碍类型 OTC_OPTION_BOOK_BARRIERTYPE
观察价格类型 OTC_OPTION_BOOK_BARRIERMONITORING
结算方式 OTC_OPTION_BOOK_SETTLEMODE
触碰类型 OTC_OPTION_BOOK_TRIGGERTYPE

   */

  // 香草期权
  exerciseType: 'OTC_OPTION_BOOK_EXERCISETYPE', //行权方式

  // 障碍期权
  barrierDuration: 'OTC_OPTION_BOOK_BARRIERDUTATION', // 观察频率
  barrierType: 'OTC_OPTION_BOOK_BARRIERTYPE', // 障碍类型
  barrierMonitoring: 'OTC_OPTION_BOOK_BARRIERMONITORING', // 观察价格类型

  // 二元期权
  triggerDuration: 'OTC_OPTION_BOOK_BARRIERDUTATION', // 观察频率
  triggerType: 'OTC_OPTION_BOOK_TRIGGERTYPE', // 触碰类型

  //雪球期权
  kiBarrierDuration: 'OTC_OPTION_SNOWBALL_KI_BARRIER_DURATION', //敲入_观察频率
  kiDirection: 'OTC_OPTION_SNOWBALL_KI_DIRECTION', // 敲入方向
  koBarrierDuration: 'OTC_OPTION_SNOWBALL_KO_BARRIER_DURATION', // 敲出_观察频率
  koDirection: 'OTC_OPTION_SNOWBALL_KO_DIRECTION', // 敲出方向
  settleModeDual: 'OTC_OPTION_BOOK_SETTLEMODE_DUAL', //结算方式

  //公用
  settleMode: 'OTC_OPTION_BOOK_SETTLEMODE', // 结算方式  障碍期权与二元期权公用
};

// 期末价格类型
export const priceTypeData = {
  index: [{ value: '2', title: '收盘价' }],
  gp: [
    { value: '2', title: '收盘价' },
    { value: '3', title: '成交均价' },
  ],
  ut: [
    { value: '1', title: '结算价' },
    { value: '2', title: '收盘价' },
  ],
};
